
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)

import App from './App'
import router from './router'

Vue.prototype.IP_URL = process.env.IP_URL

import {copy,go,openw,back} from './assets/changyong.js'
Vue.prototype.copy = copy
Vue.prototype.go = go
Vue.prototype.openw = openw
Vue.prototype.back = function(){
  router.go(-1)
}

axios.interceptors.request.use(function (config) {
  //拿一下token
  const token = localStorage.getItem('token')
  if(token){
    config.headers.Authorization = 'Bearer '+ token
  }
  console.log(config)
  return config;
}, function (error) {
  // 对请求错误做些什么
  return Promise.reject(error);
});


Vue.config.productionTip = false

new Vue({
	el: '#app',
	router,
	components: {
		App
	},
	template: '<App/>'
})
